***Figure 1***
clear 
set more off
use "cf_index.dta"
keep if year > 1965
foreach i in AK AL AR AZ CA CO CT DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI ///
MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY {
graph twoway line cf_index year if state == "`i'"
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Year
gr_edit .plotregion1.plot1.style.editstyle area(shadestyle(color(white)) linestyle(color(black))) editcopy
gr_edit .xaxis1.reset_rule 1970 2010 20 , tickset(major) ruletype(range) 
gr_edit .yaxis1.reset_rule 0 1 1 , tickset(major) ruletype(range) 
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush `i'
gr_edit .yaxis1.title.draw_view.setstyle, style(no)
*gr_edit .xaxis1.plotregion.xscale.curmax = 2017.5
*gr_edit .style.editstyle declared_ysize(3) editcopy
graph save "cf_`i'.gph", replace
}
graph combine "cf_AK.gph" ///
"cf_AL.gph" ///
"cf_AR.gph" ///
"cf_AZ.gph" ///
"cf_CA.gph" ///
"cf_CO.gph" ///
"cf_CT.gph" ///
"cf_DE.gph" ///
"cf_FL.gph" ///
"cf_GA.gph" ///
"cf_HI.gph" ///
"cf_IA.gph" ///
"cf_ID.gph" ///
"cf_IL.gph" ///
"cf_IN.gph" ///
"cf_KS.gph" ///
"cf_KY.gph" ///
"cf_LA.gph" ///
"cf_MA.gph" ///
"cf_MD.gph" ///
"cf_ME.gph" ///
"cf_MI.gph" ///
"cf_MN.gph" ///
"cf_MO.gph" ///
"cf_MS.gph" ///
"cf_MT.gph" ///
"cf_NC.gph" ///
"cf_ND.gph" ///
"cf_NE.gph" ///
"cf_NH.gph" ///
"cf_NJ.gph" ///
"cf_NM.gph" ///
"cf_NV.gph" ///
"cf_NY.gph" ///
"cf_OH.gph" ///
"cf_OK.gph" ///
"cf_OR.gph" ///
"cf_PA.gph" ///
"cf_RI.gph" ///
"cf_SC.gph" ///
"cf_SD.gph" ///
"cf_TN.gph" ///
"cf_TX.gph" ///
"cf_UT.gph" ///
"cf_VA.gph" ///
"cf_VT.gph" ///
"cf_WA.gph" ///
"cf_WI.gph" ///
"cf_WV.gph" ///
"cf_WY.gph", col(5)
gr_edit .style.editstyle margin(zero) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(6) editcopy
forvalues j = 2(5)47{
local jplus3 = `j' + 3
forvalues i = `j'/`jplus3' {
gr_edit .plotregion1.graph`i'.yaxis1.draw_view.setstyle, style(no)
}
}
forvalues i = 1/45 {
gr_edit .plotregion1.graph`i'.xaxis1.draw_view.setstyle, style(no)
}
graph export "Figure1.tif", as(tif) replace
foreach i in AK AL AR AZ CA CO CT DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI ///
MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY {
erase "cf_`i'.gph"
}


***Table 1***
clear
use "CampaignFinanceData.dta"
sort state year
merge state year using "cf_index.dta"
keep if _merge == 3
drop _merge
sum year
g time = (year - r(min))/(r(max) - r(min))
egen stateid = group(state)
sum stateid
local nstates = r(max)
forvalues i = 1/`nstates' {
g state_`i' = stateid == `i'
g time_`i' = time*state_`i'
}
drop state_*
egen state_governor = group(state governor)
*Table 1
reghdfe logdollars cf_index, a(stateid year) cluster(stateid)
qui:outreg2 cf_index using Table1, replace dec(3) noaster
disp round((exp(_b[cf_index]) - 1)*1000)/1000
xi:areg logdollars cf_index time_* time i.year, a(stateid) cluster(stateid)
qui:outreg2 cf_index using Table1, append dec(3) noaster
disp round((exp(_b[cf_index]) - 1)*1000)/1000
reghdfe logdollars cf_index, a(state_governor year) cluster(stateid)
qui:outreg2 cf_index using Table1, append dec(3) noaster
disp round((exp(_b[cf_index]) - 1)*1000)/1000
xi:areg logdollars cf_index time_* time i.year, a(state_governor) cluster(stateid)
qui:outreg2 cf_index using Table1, append dec(3) noaster
disp round((exp(_b[cf_index]) - 1)*1000)/1000

*recovering baseline contribution levels across states
xi:areg dollarspercapita cf_index i.stateid, a(year) cluster(stateid)
g statefe = 0 if stateid == 1
forvalues i = 2/50 {
replace statefe = _b[_Istateid_`i'] if stateid == `i'
}
keep state statefe
sort state
drop if state == state[_n-1]
sort statefe
g baseline = (_n - 1)/49
keep state baseline
sort state
save "baseline.dta", replace


***Generating Data Set for Subsequent Analyses***
clear
set more off
use "InsuranceOutcomeData.dta"
sort state year
merge state year using "cf_index.dta"
keep if _merge == 3
drop _merge
sum year
g time = (year - r(min))/(r(max) - r(min))
egen stateid = group(state)
sum stateid
local nstates = r(max)
forvalues i = 1/`nstates' {
g state_`i' = stateid == `i'
g time_`i' = time*state_`i'
}
drop state_*
g elected_ic = state == "DE" | state == "GA" | state == "KS" | state == "LA" ///
| state == "MS" | state == "MT" | state == "NC" | state == "ND" | state == "OK" ///
| state == "WA"
replace elected_ic = 1 if state == "CA" & year >= 1991
replace elected_ic = 1 if state == "FL" & year <= 2003
g electedic_cfindex = elected_ic*cf_index
sort state
merge state using "baseline.dta"
tab _merge
drop _merge
g baseline_cfindex = baseline*cf_index
save "fulldata.dta", replace


*Premiums, Table A1
clear
set more off
use "fulldata.dta"
*mean DV
sum premiums
scalar meandv = r(mean)
*point estimates and standard errors
reghdfe premiums cf_index, a(stateid year) cluster(stateid)
scalar cf1 = _b[cf_index]
scalar se_cf1 = _se[cf_index]
xi:areg premiums cf_index time_* time i.year, a(stateid) cluster(stateid)
scalar cf2 = _b[cf_index]
scalar se_cf2 = _se[cf_index]
reghdfe premiums cf_index elected_ic electedic_cfindex, a(stateid year) cluster(stateid)
scalar cf3 = _b[cf_index]
scalar se_cf3 = _se[cf_index]
scalar ic3 = _b[elected_ic]
scalar se_ic3 = _se[elected_ic]
scalar int3 = _b[electedic_cfindex]
scalar se_int3 = _se[electedic_cfindex]
xi:areg premiums cf_index elected_ic electedic_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf4 = _b[cf_index]
scalar se_cf4 = _se[cf_index]
scalar ic4 = _b[elected_ic]
scalar se_ic4 = _se[elected_ic]
scalar int4 = _b[electedic_cfindex]
scalar se_int4 = _se[electedic_cfindex]
reghdfe premiums cf_index baseline_cfindex, a(stateid year) cluster(stateid)
scalar cf5 = _b[cf_index]
scalar se_cf5 = _se[cf_index]
scalar bl5 = _b[baseline_cfindex]
scalar se_bl5 = _se[baseline_cfindex]
xi:areg premiums cf_index baseline_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf6 = _b[cf_index]
scalar se_cf6 = _se[cf_index]
scalar bl6 = _b[baseline_cfindex]
scalar se_bl6 = _se[baseline_cfindex]
postutil clear
postfile Table col1 col2 col3 col4 col5 col6 using "Table.dta", replace
post Table (cf1) (cf2) (cf3) (cf4) (cf5) (cf6)
post Table (se_cf1) (se_cf2) (se_cf3) (se_cf4) (se_cf5) (se_cf6)
post Table (.) (.) (ic3) (ic4) (.) (.)
post Table (.) (.) (se_ic3) (se_ic4) (.) (.)
post Table (.) (.) (int3) (int4) (.) (.)
post Table (.) (.) (se_int3) (se_int4) (.) (.)
post Table (.) (.) (.) (.) (bl5) (bl6)
post Table (.) (.) (.) (.) (se_bl5) (se_bl6)
postclose Table 
clear
use "Table.dta"
browse
forvalues i = 1/6 {
tostring col`i', replace format(%5.1f) force 
replace col`i' = subinstr(col`i', "0.", ".", .) 
replace col`i' = "" if col`i' == "."
replace col`i' = "(" + col`i' + ")" if floor((_n)/2) == (_n)/2 & col`i' != ""
}
disp meandv
save "TableA1.dta", replace

*Premium Tax Rate, Table A2
clear
set more off
use "fulldata.dta"
*mean DV
sum taxrate
scalar meandv = r(mean)
*point estimates and standard errors
reghdfe taxrate cf_index, a(stateid year) cluster(stateid)
scalar cf1 = _b[cf_index]
scalar se_cf1 = _se[cf_index]
xi:areg taxrate cf_index time_* time i.year, a(stateid) cluster(stateid)
scalar cf2 = _b[cf_index]
scalar se_cf2 = _se[cf_index]
reghdfe taxrate cf_index elected_ic electedic_cfindex, a(stateid year) cluster(stateid)
scalar cf3 = _b[cf_index]
scalar se_cf3 = _se[cf_index]
scalar ic3 = _b[elected_ic]
scalar se_ic3 = _se[elected_ic]
scalar int3 = _b[electedic_cfindex]
scalar se_int3 = _se[electedic_cfindex]
xi:areg taxrate cf_index elected_ic electedic_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf4 = _b[cf_index]
scalar se_cf4 = _se[cf_index]
scalar ic4 = _b[elected_ic]
scalar se_ic4 = _se[elected_ic]
scalar int4 = _b[electedic_cfindex]
scalar se_int4 = _se[electedic_cfindex]
reghdfe taxrate cf_index baseline_cfindex, a(stateid year) cluster(stateid)
scalar cf5 = _b[cf_index]
scalar se_cf5 = _se[cf_index]
scalar bl5 = _b[baseline_cfindex]
scalar se_bl5 = _se[baseline_cfindex]
xi:areg taxrate cf_index baseline_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf6 = _b[cf_index]
scalar se_cf6 = _se[cf_index]
scalar bl6 = _b[baseline_cfindex]
scalar se_bl6 = _se[baseline_cfindex]
postutil clear
postfile Table col1 col2 col3 col4 col5 col6 using "Table.dta", replace
post Table (cf1) (cf2) (cf3) (cf4) (cf5) (cf6)
post Table (se_cf1) (se_cf2) (se_cf3) (se_cf4) (se_cf5) (se_cf6)
post Table (.) (.) (ic3) (ic4) (.) (.)
post Table (.) (.) (se_ic3) (se_ic4) (.) (.)
post Table (.) (.) (int3) (int4) (.) (.)
post Table (.) (.) (se_int3) (se_int4) (.) (.)
post Table (.) (.) (.) (.) (bl5) (bl6)
post Table (.) (.) (.) (.) (se_bl5) (se_bl6)
postclose Table 
clear
use "Table.dta"
browse
forvalues i = 1/6 {
tostring col`i', replace format(%5.3f) force 
replace col`i' = subinstr(col`i', "0.", ".", .) 
replace col`i' = "" if col`i' == "."
replace col`i' = "(" + col`i' + ")" if floor((_n)/2) == (_n)/2 & col`i' != ""
}
disp meandv
save "TableA2.dta", replace

*Guaranty Fund Net Assessments, Table A3
clear
set more off
use "fulldata.dta"
*mean DV
sum assessments
scalar meandv = r(mean)
*point estimates and standard errors
reghdfe assessments cf_index, a(stateid year) cluster(stateid)
scalar cf1 = _b[cf_index]
scalar se_cf1 = _se[cf_index]
xi:areg assessments cf_index time_* time i.year, a(stateid) cluster(stateid)
scalar cf2 = _b[cf_index]
scalar se_cf2 = _se[cf_index]
reghdfe assessments cf_index elected_ic electedic_cfindex, a(stateid year) cluster(stateid)
scalar cf3 = _b[cf_index]
scalar se_cf3 = _se[cf_index]
scalar ic3 = _b[elected_ic]
scalar se_ic3 = _se[elected_ic]
scalar int3 = _b[electedic_cfindex]
scalar se_int3 = _se[electedic_cfindex]
xi:areg assessments cf_index elected_ic electedic_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf4 = _b[cf_index]
scalar se_cf4 = _se[cf_index]
scalar ic4 = _b[elected_ic]
scalar se_ic4 = _se[elected_ic]
scalar int4 = _b[electedic_cfindex]
scalar se_int4 = _se[electedic_cfindex]
reghdfe assessments cf_index baseline_cfindex, a(stateid year) cluster(stateid)
scalar cf5 = _b[cf_index]
scalar se_cf5 = _se[cf_index]
scalar bl5 = _b[baseline_cfindex]
scalar se_bl5 = _se[baseline_cfindex]
xi:areg assessments cf_index baseline_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf6 = _b[cf_index]
scalar se_cf6 = _se[cf_index]
scalar bl6 = _b[baseline_cfindex]
scalar se_bl6 = _se[baseline_cfindex]
postutil clear
postfile Table col1 col2 col3 col4 col5 col6 using "Table.dta", replace
post Table (cf1) (cf2) (cf3) (cf4) (cf5) (cf6)
post Table (se_cf1) (se_cf2) (se_cf3) (se_cf4) (se_cf5) (se_cf6)
post Table (.) (.) (ic3) (ic4) (.) (.)
post Table (.) (.) (se_ic3) (se_ic4) (.) (.)
post Table (.) (.) (int3) (int4) (.) (.)
post Table (.) (.) (se_int3) (se_int4) (.) (.)
post Table (.) (.) (.) (.) (bl5) (bl6)
post Table (.) (.) (.) (.) (se_bl5) (se_bl6)
postclose Table 
clear
use "Table.dta"
browse
forvalues i = 1/6 {
tostring col`i', replace format(%5.2f) force 
replace col`i' = "" if col`i' == "."
replace col`i' = "(" + col`i' + ")" if floor((_n)/2) == (_n)/2 & col`i' != ""
}
disp meandv
save "TableA3.dta", replace

*Auto Limits, Table A4
clear
set more off
use "fulldata.dta"
*mean DV
sum automin
scalar meandv = r(mean)
*point estimates and standard errors
reghdfe automin cf_index, a(stateid year) cluster(stateid)
scalar cf1 = _b[cf_index]
scalar se_cf1 = _se[cf_index]
xi:areg automin cf_index time_* time i.year, a(stateid) cluster(stateid)
scalar cf2 = _b[cf_index]
scalar se_cf2 = _se[cf_index]
reghdfe automin cf_index elected_ic electedic_cfindex, a(stateid year) cluster(stateid)
scalar cf3 = _b[cf_index]
scalar se_cf3 = _se[cf_index]
scalar ic3 = _b[elected_ic]
scalar se_ic3 = _se[elected_ic]
scalar int3 = _b[electedic_cfindex]
scalar se_int3 = _se[electedic_cfindex]
xi:areg automin cf_index elected_ic electedic_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf4 = _b[cf_index]
scalar se_cf4 = _se[cf_index]
scalar ic4 = _b[elected_ic]
scalar se_ic4 = _se[elected_ic]
scalar int4 = _b[electedic_cfindex]
scalar se_int4 = _se[electedic_cfindex]
reghdfe automin cf_index baseline_cfindex, a(stateid year) cluster(stateid)
scalar cf5 = _b[cf_index]
scalar se_cf5 = _se[cf_index]
scalar bl5 = _b[baseline_cfindex]
scalar se_bl5 = _se[baseline_cfindex]
xi:areg automin cf_index baseline_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf6 = _b[cf_index]
scalar se_cf6 = _se[cf_index]
scalar bl6 = _b[baseline_cfindex]
scalar se_bl6 = _se[baseline_cfindex]
postutil clear
postfile Table col1 col2 col3 col4 col5 col6 using "Table.dta", replace
post Table (cf1) (cf2) (cf3) (cf4) (cf5) (cf6)
post Table (se_cf1) (se_cf2) (se_cf3) (se_cf4) (se_cf5) (se_cf6)
post Table (.) (.) (ic3) (ic4) (.) (.)
post Table (.) (.) (se_ic3) (se_ic4) (.) (.)
post Table (.) (.) (int3) (int4) (.) (.)
post Table (.) (.) (se_int3) (se_int4) (.) (.)
post Table (.) (.) (.) (.) (bl5) (bl6)
post Table (.) (.) (.) (.) (se_bl5) (se_bl6)
postclose Table 
clear
use "Table.dta"
browse
forvalues i = 1/6 {
tostring col`i', replace format(%5.1f) force 
replace col`i' = subinstr(col`i', "0.", ".", .) 
replace col`i' = "" if col`i' == "."
replace col`i' = "(" + col`i' + ")" if floor((_n)/2) == (_n)/2 & col`i' != ""
}
disp meandv
save "TableA4.dta", replace

*Commissioner Backgrounds, Table A5
clear
set more off
use "fulldata.dta"
*mean DV
sum commissioner
scalar meandv = r(mean)
*point estimates and standard errors
reghdfe commissioner cf_index, a(stateid year) cluster(stateid)
scalar cf1 = _b[cf_index]
scalar se_cf1 = _se[cf_index]
xi:areg commissioner cf_index time_* time i.year, a(stateid) cluster(stateid)
scalar cf2 = _b[cf_index]
scalar se_cf2 = _se[cf_index]
reghdfe commissioner cf_index elected_ic electedic_cfindex, a(stateid year) cluster(stateid)
scalar cf3 = _b[cf_index]
scalar se_cf3 = _se[cf_index]
scalar ic3 = _b[elected_ic]
scalar se_ic3 = _se[elected_ic]
scalar int3 = _b[electedic_cfindex]
scalar se_int3 = _se[electedic_cfindex]
xi:areg commissioner cf_index elected_ic electedic_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf4 = _b[cf_index]
scalar se_cf4 = _se[cf_index]
scalar ic4 = _b[elected_ic]
scalar se_ic4 = _se[elected_ic]
scalar int4 = _b[electedic_cfindex]
scalar se_int4 = _se[electedic_cfindex]
reghdfe commissioner cf_index baseline_cfindex, a(stateid year) cluster(stateid)
scalar cf5 = _b[cf_index]
scalar se_cf5 = _se[cf_index]
scalar bl5 = _b[baseline_cfindex]
scalar se_bl5 = _se[baseline_cfindex]
xi:areg commissioner cf_index baseline_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf6 = _b[cf_index]
scalar se_cf6 = _se[cf_index]
scalar bl6 = _b[baseline_cfindex]
scalar se_bl6 = _se[baseline_cfindex]
postutil clear
postfile Table col1 col2 col3 col4 col5 col6 using "Table.dta", replace
post Table (cf1) (cf2) (cf3) (cf4) (cf5) (cf6)
post Table (se_cf1) (se_cf2) (se_cf3) (se_cf4) (se_cf5) (se_cf6)
post Table (.) (.) (ic3) (ic4) (.) (.)
post Table (.) (.) (se_ic3) (se_ic4) (.) (.)
post Table (.) (.) (int3) (int4) (.) (.)
post Table (.) (.) (se_int3) (se_int4) (.) (.)
post Table (.) (.) (.) (.) (bl5) (bl6)
post Table (.) (.) (.) (.) (se_bl5) (se_bl6)
postclose Table 
clear
use "Table.dta"
browse
forvalues i = 1/6 {
tostring col`i', replace format(%5.3f) force 
replace col`i' = subinstr(col`i', "0.", ".", .) 
replace col`i' = "" if col`i' == "."
replace col`i' = "(" + col`i' + ")" if floor((_n)/2) == (_n)/2 & col`i' != ""
}
disp meandv
save "TableA5.dta", replace

*Number of Companies, Table A6
clear
set more off
use "fulldata.dta"
*mean DV
sum companies
scalar meandv = r(mean)
*point estimates and standard errors
reghdfe companies cf_index, a(stateid year) cluster(stateid)
scalar cf1 = _b[cf_index]
scalar se_cf1 = _se[cf_index]
xi:areg companies cf_index time_* time i.year, a(stateid) cluster(stateid)
scalar cf2 = _b[cf_index]
scalar se_cf2 = _se[cf_index]
reghdfe companies cf_index elected_ic electedic_cfindex, a(stateid year) cluster(stateid)
scalar cf3 = _b[cf_index]
scalar se_cf3 = _se[cf_index]
scalar ic3 = _b[elected_ic]
scalar se_ic3 = _se[elected_ic]
scalar int3 = _b[electedic_cfindex]
scalar se_int3 = _se[electedic_cfindex]
xi:areg companies cf_index elected_ic electedic_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf4 = _b[cf_index]
scalar se_cf4 = _se[cf_index]
scalar ic4 = _b[elected_ic]
scalar se_ic4 = _se[elected_ic]
scalar int4 = _b[electedic_cfindex]
scalar se_int4 = _se[electedic_cfindex]
reghdfe companies cf_index baseline_cfindex, a(stateid year) cluster(stateid)
scalar cf5 = _b[cf_index]
scalar se_cf5 = _se[cf_index]
scalar bl5 = _b[baseline_cfindex]
scalar se_bl5 = _se[baseline_cfindex]
xi:areg companies cf_index baseline_cfindex time_* time i.year, a(stateid) cluster(stateid)
scalar cf6 = _b[cf_index]
scalar se_cf6 = _se[cf_index]
scalar bl6 = _b[baseline_cfindex]
scalar se_bl6 = _se[baseline_cfindex]
postutil clear
postfile Table col1 col2 col3 col4 col5 col6 using "Table.dta", replace
post Table (cf1) (cf2) (cf3) (cf4) (cf5) (cf6)
post Table (se_cf1) (se_cf2) (se_cf3) (se_cf4) (se_cf5) (se_cf6)
post Table (.) (.) (ic3) (ic4) (.) (.)
post Table (.) (.) (se_ic3) (se_ic4) (.) (.)
post Table (.) (.) (int3) (int4) (.) (.)
post Table (.) (.) (se_int3) (se_int4) (.) (.)
post Table (.) (.) (.) (.) (bl5) (bl6)
post Table (.) (.) (.) (.) (se_bl5) (se_bl6)
postclose Table 
clear
use "Table.dta"
browse
forvalues i = 1/6 {
tostring col`i', replace format(%5.3f) force 
replace col`i' = subinstr(col`i', "0.", ".", .) 
replace col`i' = "" if col`i' == "."
replace col`i' = "(" + col`i' + ")" if floor((_n)/2) == (_n)/2 & col`i' != ""
}
disp meandv
save "TableA6.dta", replace


***Figure 2***
clear
set more off
postutil clear
use "fulldata.dta"
foreach i in premiums taxrate assessments automin commissioner companies {
sum `i'
replace `i' = (`i' - r(mean))/r(sd)
}
foreach i in premiums automin commissioner companies {
replace `i' = `i'*-1
}
postfile Standardized coef sterr pval using "Standardized.dta", replace
foreach i in premiums taxrate assessments automin commissioner {
reghdfe `i' cf_index, a(stateid year) cluster(stateid)
post Standardized (_b[cf_index]) (_se[cf_index]) (ttail(e(df_r),(_b[cf_index]/_se[cf_index])))
xi:areg `i' cf_index time_* time i.year, a(stateid) cluster(stateid)
post Standardized (_b[cf_index]) (_se[cf_index]) (ttail(e(df_r),(_b[cf_index]/_se[cf_index])))
reghdfe `i' cf_index elected_ic electedic_cfindex, a(stateid year) cluster(stateid)
post Standardized (_b[electedic_cfindex]) (_se[electedic_cfindex]) (ttail(e(df_r),(_b[electedic_cfindex]/_se[electedic_cfindex])))
xi:areg `i' cf_index elected_ic electedic_cfindex time_* time i.year, a(stateid) cluster(stateid)
post Standardized (_b[electedic_cfindex]) (_se[electedic_cfindex]) (ttail(e(df_r),(_b[electedic_cfindex]/_se[electedic_cfindex])))
reghdfe `i' cf_index baseline_cfindex, a(stateid year) cluster(stateid)
post Standardized (_b[baseline_cfindex]) (_se[baseline_cfindex]) (ttail(e(df_r),(_b[baseline_cfindex]/_se[baseline_cfindex])))
xi:areg `i' cf_index baseline_cfindex time_* time i.year, a(stateid) cluster(stateid)
post Standardized (_b[baseline_cfindex]) (_se[baseline_cfindex]) (ttail(e(df_r),(_b[baseline_cfindex]/_se[baseline_cfindex])))
}
postclose Standardized
clear
use "Standardized.dta"
hist coef, start(-1.2) width(.2) frequency
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Standardized Coefficients
gr_edit .plotregion1.plot1.style.editstyle area(shadestyle(color(white)) linestyle(color(black))) editcopy
*gr_edit .xaxis1.reset_rule -.2 .2 .1 , tickset(major) ruletype(range) 
*gr_edit .yaxis1.reset_rule 0 15 5 , tickset(major) ruletype(range) 
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .style.editstyle declared_ysize(3) editcopy
graph save "Coefficients.gph", replace
hist pval, start(0) width(.05) frequency
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush p-Values
gr_edit .plotregion1.plot1.style.editstyle area(shadestyle(color(white)) linestyle(color(black))) editcopy
*gr_edit .xaxis1.reset_rule -.2 .2 .1 , tickset(major) ruletype(range) 
*gr_edit .yaxis1.reset_rule 0 15 5 , tickset(major) ruletype(range) 
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .style.editstyle declared_ysize(3) editcopy
graph save "pValues.gph", replace
graph combine "Coefficients.gph" "pValues.gph", col(1)
gr_edit .style.editstyle margin(zero) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .style.editstyle declared_ysize(6) editcopy
graph export "Figure2.tif", replace as(tif)


*Figure 3
clear
set more off
use "fulldata.dta"
sort state year
forvalues i = 1/4 {
g lead`i' = cf_index[_n+`i'] if state == state[_n+`i'] & year == year[_n+`i'] - `i'
g lag`i' = cf_index[_n-`i'] if state == state[_n-`i'] & year == year[_n-`i'] + `i'
}
postfile LeadsLags outcome time coef upper lower using "LeadsLags.dta", replace
reghdfe premiums lead4 lead3 lead2 lead1 cf_index lag1 lag2 lag3 lag4, a(stateid year) cluster(stateid)
post LeadsLags (1) (-4) (_b[lead4]) (_b[lead4] + _se[lead4]*invttail(e(df_r),.025)) (_b[lead4] - _se[lead4]*invttail(e(df_r),.025)) 
post LeadsLags (1) (-3) (_b[lead3]) (_b[lead3] + _se[lead3]*invttail(e(df_r),.025)) (_b[lead3] - _se[lead3]*invttail(e(df_r),.025)) 
post LeadsLags (1) (-2) (_b[lead2]) (_b[lead2] + _se[lead2]*invttail(e(df_r),.025)) (_b[lead2] - _se[lead2]*invttail(e(df_r),.025)) 
post LeadsLags (1) (-1) (_b[lead1]) (_b[lead1] + _se[lead1]*invttail(e(df_r),.025)) (_b[lead1] - _se[lead1]*invttail(e(df_r),.025)) 
post LeadsLags (1) (0) (_b[cf_index]) (_b[cf_index] + _se[cf_index]*invttail(e(df_r),.025)) (_b[cf_index] - _se[cf_index]*invttail(e(df_r),.025)) 
post LeadsLags (1) (1) (_b[lag1]) (_b[lag1] + _se[lag1]*invttail(e(df_r),.025)) (_b[lag1] - _se[lag1]*invttail(e(df_r),.025)) 
post LeadsLags (1) (2) (_b[lag2]) (_b[lag2] + _se[lag2]*invttail(e(df_r),.025)) (_b[lag2] - _se[lag2]*invttail(e(df_r),.025)) 
post LeadsLags (1) (3) (_b[lag3]) (_b[lag3] + _se[lag3]*invttail(e(df_r),.025)) (_b[lag3] - _se[lag3]*invttail(e(df_r),.025)) 
post LeadsLags (1) (4) (_b[lag4]) (_b[lag4] + _se[lag4]*invttail(e(df_r),.025)) (_b[lag4] - _se[lag4]*invttail(e(df_r),.025)) 
reghdfe taxrate lead4 lead3 lead2 lead1 cf_index lag1 lag2 lag3 lag4, a(stateid year) cluster(stateid)
post LeadsLags (2) (-4) (_b[lead4]) (_b[lead4] + _se[lead4]*invttail(e(df_r),.025)) (_b[lead4] - _se[lead4]*invttail(e(df_r),.025)) 
post LeadsLags (2) (-3) (_b[lead3]) (_b[lead3] + _se[lead3]*invttail(e(df_r),.025)) (_b[lead3] - _se[lead3]*invttail(e(df_r),.025)) 
post LeadsLags (2) (-2) (_b[lead2]) (_b[lead2] + _se[lead2]*invttail(e(df_r),.025)) (_b[lead2] - _se[lead2]*invttail(e(df_r),.025)) 
post LeadsLags (2) (-1) (_b[lead1]) (_b[lead1] + _se[lead1]*invttail(e(df_r),.025)) (_b[lead1] - _se[lead1]*invttail(e(df_r),.025)) 
post LeadsLags (2) (0) (_b[cf_index]) (_b[cf_index] + _se[cf_index]*invttail(e(df_r),.025)) (_b[cf_index] - _se[cf_index]*invttail(e(df_r),.025)) 
post LeadsLags (2) (1) (_b[lag1]) (_b[lag1] + _se[lag1]*invttail(e(df_r),.025)) (_b[lag1] - _se[lag1]*invttail(e(df_r),.025)) 
post LeadsLags (2) (2) (_b[lag2]) (_b[lag2] + _se[lag2]*invttail(e(df_r),.025)) (_b[lag2] - _se[lag2]*invttail(e(df_r),.025)) 
post LeadsLags (2) (3) (_b[lag3]) (_b[lag3] + _se[lag3]*invttail(e(df_r),.025)) (_b[lag3] - _se[lag3]*invttail(e(df_r),.025)) 
post LeadsLags (2) (4) (_b[lag4]) (_b[lag4] + _se[lag4]*invttail(e(df_r),.025)) (_b[lag4] - _se[lag4]*invttail(e(df_r),.025)) 
reghdfe assessments lead4 lead3 lead2 lead1 cf_index lag1 lag2 lag3 lag4, a(stateid year) cluster(stateid)
post LeadsLags (3) (-4) (_b[lead4]) (_b[lead4] + _se[lead4]*invttail(e(df_r),.025)) (_b[lead4] - _se[lead4]*invttail(e(df_r),.025)) 
post LeadsLags (3) (-3) (_b[lead3]) (_b[lead3] + _se[lead3]*invttail(e(df_r),.025)) (_b[lead3] - _se[lead3]*invttail(e(df_r),.025)) 
post LeadsLags (3) (-2) (_b[lead2]) (_b[lead2] + _se[lead2]*invttail(e(df_r),.025)) (_b[lead2] - _se[lead2]*invttail(e(df_r),.025)) 
post LeadsLags (3) (-1) (_b[lead1]) (_b[lead1] + _se[lead1]*invttail(e(df_r),.025)) (_b[lead1] - _se[lead1]*invttail(e(df_r),.025)) 
post LeadsLags (3) (0) (_b[cf_index]) (_b[cf_index] + _se[cf_index]*invttail(e(df_r),.025)) (_b[cf_index] - _se[cf_index]*invttail(e(df_r),.025)) 
post LeadsLags (3) (1) (_b[lag1]) (_b[lag1] + _se[lag1]*invttail(e(df_r),.025)) (_b[lag1] - _se[lag1]*invttail(e(df_r),.025)) 
post LeadsLags (3) (2) (_b[lag2]) (_b[lag2] + _se[lag2]*invttail(e(df_r),.025)) (_b[lag2] - _se[lag2]*invttail(e(df_r),.025)) 
post LeadsLags (3) (3) (_b[lag3]) (_b[lag3] + _se[lag3]*invttail(e(df_r),.025)) (_b[lag3] - _se[lag3]*invttail(e(df_r),.025)) 
post LeadsLags (3) (4) (_b[lag4]) (_b[lag4] + _se[lag4]*invttail(e(df_r),.025)) (_b[lag4] - _se[lag4]*invttail(e(df_r),.025)) 
reghdfe automin lead4 lead3 lead2 lead1 cf_index lag1 lag2 lag3 lag4, a(stateid year) cluster(stateid)
post LeadsLags (4) (-4) (_b[lead4]) (_b[lead4] + _se[lead4]*invttail(e(df_r),.025)) (_b[lead4] - _se[lead4]*invttail(e(df_r),.025)) 
post LeadsLags (4) (-3) (_b[lead3]) (_b[lead3] + _se[lead3]*invttail(e(df_r),.025)) (_b[lead3] - _se[lead3]*invttail(e(df_r),.025)) 
post LeadsLags (4) (-2) (_b[lead2]) (_b[lead2] + _se[lead2]*invttail(e(df_r),.025)) (_b[lead2] - _se[lead2]*invttail(e(df_r),.025)) 
post LeadsLags (4) (-1) (_b[lead1]) (_b[lead1] + _se[lead1]*invttail(e(df_r),.025)) (_b[lead1] - _se[lead1]*invttail(e(df_r),.025)) 
post LeadsLags (4) (0) (_b[cf_index]) (_b[cf_index] + _se[cf_index]*invttail(e(df_r),.025)) (_b[cf_index] - _se[cf_index]*invttail(e(df_r),.025)) 
post LeadsLags (4) (1) (_b[lag1]) (_b[lag1] + _se[lag1]*invttail(e(df_r),.025)) (_b[lag1] - _se[lag1]*invttail(e(df_r),.025)) 
post LeadsLags (4) (2) (_b[lag2]) (_b[lag2] + _se[lag2]*invttail(e(df_r),.025)) (_b[lag2] - _se[lag2]*invttail(e(df_r),.025)) 
post LeadsLags (4) (3) (_b[lag3]) (_b[lag3] + _se[lag3]*invttail(e(df_r),.025)) (_b[lag3] - _se[lag3]*invttail(e(df_r),.025)) 
post LeadsLags (4) (4) (_b[lag4]) (_b[lag4] + _se[lag4]*invttail(e(df_r),.025)) (_b[lag4] - _se[lag4]*invttail(e(df_r),.025)) 
reghdfe commissioner lead4 lead3 lead2 lead1 cf_index lag1 lag2 lag3 lag4, a(stateid year) cluster(stateid)
post LeadsLags (5) (-4) (_b[lead4]) (_b[lead4] + _se[lead4]*invttail(e(df_r),.025)) (_b[lead4] - _se[lead4]*invttail(e(df_r),.025)) 
post LeadsLags (5) (-3) (_b[lead3]) (_b[lead3] + _se[lead3]*invttail(e(df_r),.025)) (_b[lead3] - _se[lead3]*invttail(e(df_r),.025)) 
post LeadsLags (5) (-2) (_b[lead2]) (_b[lead2] + _se[lead2]*invttail(e(df_r),.025)) (_b[lead2] - _se[lead2]*invttail(e(df_r),.025)) 
post LeadsLags (5) (-1) (_b[lead1]) (_b[lead1] + _se[lead1]*invttail(e(df_r),.025)) (_b[lead1] - _se[lead1]*invttail(e(df_r),.025)) 
post LeadsLags (5) (0) (_b[cf_index]) (_b[cf_index] + _se[cf_index]*invttail(e(df_r),.025)) (_b[cf_index] - _se[cf_index]*invttail(e(df_r),.025)) 
post LeadsLags (5) (1) (_b[lag1]) (_b[lag1] + _se[lag1]*invttail(e(df_r),.025)) (_b[lag1] - _se[lag1]*invttail(e(df_r),.025)) 
post LeadsLags (5) (2) (_b[lag2]) (_b[lag2] + _se[lag2]*invttail(e(df_r),.025)) (_b[lag2] - _se[lag2]*invttail(e(df_r),.025)) 
post LeadsLags (5) (3) (_b[lag3]) (_b[lag3] + _se[lag3]*invttail(e(df_r),.025)) (_b[lag3] - _se[lag3]*invttail(e(df_r),.025)) 
post LeadsLags (5) (4) (_b[lag4]) (_b[lag4] + _se[lag4]*invttail(e(df_r),.025)) (_b[lag4] - _se[lag4]*invttail(e(df_r),.025))
reghdfe companies lead4 lead3 lead2 lead1 cf_index lag1 lag2 lag3 lag4, a(stateid year) cluster(stateid)
post LeadsLags (6) (-4) (_b[lead4]) (_b[lead4] + _se[lead4]*invttail(e(df_r),.025)) (_b[lead4] - _se[lead4]*invttail(e(df_r),.025)) 
post LeadsLags (6) (-3) (_b[lead3]) (_b[lead3] + _se[lead3]*invttail(e(df_r),.025)) (_b[lead3] - _se[lead3]*invttail(e(df_r),.025)) 
post LeadsLags (6) (-2) (_b[lead2]) (_b[lead2] + _se[lead2]*invttail(e(df_r),.025)) (_b[lead2] - _se[lead2]*invttail(e(df_r),.025)) 
post LeadsLags (6) (-1) (_b[lead1]) (_b[lead1] + _se[lead1]*invttail(e(df_r),.025)) (_b[lead1] - _se[lead1]*invttail(e(df_r),.025)) 
post LeadsLags (6) (0) (_b[cf_index]) (_b[cf_index] + _se[cf_index]*invttail(e(df_r),.025)) (_b[cf_index] - _se[cf_index]*invttail(e(df_r),.025)) 
post LeadsLags (6) (1) (_b[lag1]) (_b[lag1] + _se[lag1]*invttail(e(df_r),.025)) (_b[lag1] - _se[lag1]*invttail(e(df_r),.025)) 
post LeadsLags (6) (2) (_b[lag2]) (_b[lag2] + _se[lag2]*invttail(e(df_r),.025)) (_b[lag2] - _se[lag2]*invttail(e(df_r),.025)) 
post LeadsLags (6) (3) (_b[lag3]) (_b[lag3] + _se[lag3]*invttail(e(df_r),.025)) (_b[lag3] - _se[lag3]*invttail(e(df_r),.025)) 
post LeadsLags (6) (4) (_b[lag4]) (_b[lag4] + _se[lag4]*invttail(e(df_r),.025)) (_b[lag4] - _se[lag4]*invttail(e(df_r),.025))
postclose LeadsLags
clear
use "LeadsLags.dta"
graph twoway line coef upper lower time if outcome == 1, yline(0)
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Years Relative to Change
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Premiums
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.reset_rule -150 150 150 , tickset(major) ruletype(range) 
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1._xylines[1].style.editstyle linestyle(color(black) pattern(dash)) editcopy
graph save "LeadsLags1.gph", replace
graph twoway line coef upper lower time if outcome == 2, yline(0)
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Years Relative to Change
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Premium Tax Rates
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.reset_rule -.01 .01 .01 , tickset(major) ruletype(range) 
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1._xylines[1].style.editstyle linestyle(color(black) pattern(dash)) editcopy
graph save "LeadsLags2.gph", replace
graph twoway line coef upper lower time if outcome == 3, yline(0)
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Years Relative to Change
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Guaranty Fund Assessments
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.reset_rule -20 20 20 , tickset(major) ruletype(range) 
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1._xylines[1].style.editstyle linestyle(color(black) pattern(dash)) editcopy
graph save "LeadsLags3.gph", replace
graph twoway line coef upper lower time if outcome == 4, yline(0)
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Years Relative to Change
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Auto Limits
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.reset_rule -40 40 40 , tickset(major) ruletype(range) 
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1._xylines[1].style.editstyle linestyle(color(black) pattern(dash)) editcopy
graph save "LeadsLags4.gph", replace
graph twoway line coef upper lower time if outcome == 5, yline(0)
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Years Relative to Change
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Commissioner Backgrounds
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.reset_rule -.5 .5 .5, tickset(major) ruletype(range) 
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1._xylines[1].style.editstyle linestyle(color(black) pattern(dash)) editcopy
graph save "LeadsLags5.gph", replace
graph twoway line coef upper lower time if outcome == 6, yline(0)
gr_edit .legend.draw_view.setstyle, style(no)
gr_edit .xaxis1.title.text = {}
gr_edit .xaxis1.title.text.Arrpush Years Relative to Change
gr_edit .title.style.editstyle color(black) editcopy
gr_edit .title.text = {}
gr_edit .title.text.Arrpush Companies
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
gr_edit .yaxis1.style.editstyle majorstyle(gridstyle(linestyle(color(white)))) editcopy
gr_edit .yaxis1.reset_rule -.5 .5 .5, tickset(major) ruletype(range) 
gr_edit .plotregion1.plot1.style.editstyle line(color(black) width(thick)) editcopy
gr_edit .plotregion1.plot2.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1.plot3.style.editstyle line(color(black) pattern(dot)) editcopy
gr_edit .plotregion1._xylines[1].style.editstyle linestyle(color(black) pattern(dash)) editcopy
graph save "LeadsLags6.gph", replace
graph combine "LeadsLags1.gph" "LeadsLags2.gph" "LeadsLags3.gph" "LeadsLags4.gph" "LeadsLags5.gph" "LeadsLags6.gph", col(2)
gr_edit .style.editstyle declared_ysize(5.5) editcopy
forvalues i = 1/6 {
gr_edit .plotregion1.graph`i'.title.style.editstyle size(medlarge) editcopy
}
gr_edit .plotregion1.graph1.xaxis1.title.draw_view.setstyle, style(no)
gr_edit .plotregion1.graph2.xaxis1.title.draw_view.setstyle, style(no)
gr_edit .plotregion1.graph3.xaxis1.title.draw_view.setstyle, style(no)
gr_edit .plotregion1.graph4.xaxis1.title.draw_view.setstyle, style(no)
gr_edit .style.editstyle margin(vsmall) boxstyle(shadestyle(color(white)) linestyle(color(white))) editcopy
graph export "Figure3.tif", replace as(tif)



